﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shumei.EFCore.Model
{
    public class User
    {
        [Key]
        [StringLength(20, MinimumLength = 4)]
        public string account { get; set; }
        [Required]
        public string password { get; set; }
        [Required]
        [StringLength(20, MinimumLength = 4)]
        public string name { get; set; }
        [Required]
        public int sex { get; set; }

        /// <summary>
        /// 玩家头像
        /// </summary>
        public string headIcon { get; set; }
        /// <summary>
        /// 用户的角色 1学生，2 老师
        /// </summary>
        [Required]
        public int Role { get; set; }
        [Required]
        public DateTime regTime { get; set; }

        /// <summary>
        /// 如果是老师的话，可能会教多门课程
        /// </summary>
        public virtual List<Course> teachCourse { get; set; }

        /// <summary>
        /// 如果是学生的话，可能会学习多门课程
        /// </summary>
        public virtual List<Course_Study> studyCourse { get; set; }


        /// <summary>
        /// 学习记录..
        /// </summary>
        public virtual List<Course_StudyRecord> studyRecords { get; set; }
    }
}
